import subprocess
import IPy
a = input("输入:")
ips = IPy.IP(a)
for ip in ips:
    subprocess.Popen(args=[f'ping -c 1 {ip}&>/dev/null && echo {ip}已被使用 >> scan_ip.txt || echo {ip}未被使用 >> scan_ip.txt'], shell=True)

